<?php 
include_once('includes.php'); 	
?>
<?php include_once('includes/header.php'); 	 ?>
<span class="title">All Team</span>

<table class="col1"> 
	<thead>
		<tr>
			<th> Logo </th>
			<th> Name</th>
			<th  style="width:100px"> </th>
		</tr>
	</thead>
	
<?php 
$sql = "select *  from team order by id desc ";
$teams=db_fetch_all($sql);
foreach($teams as $team)
{
	$team->logo = (check_file($_SERVER["DOCUMENT_ROOT"].$team->logo))?$team->logo:"/images/football.png";

?>
	<tr>
		<td><img src="<?php echo $team->logo;?>" style="height:50px"/></td>
		<td style="text-align:left"><?php echo $team->name;?></td>
		<td><a href="create-team?id=<?php echo $team->id; ?>">Edit</a> | <a onclick="if(!confirm('Do you want to delete this team?')) return false;" href="create-team?task=delete&id=<?php echo $team->id; ?>">Delete</a></td>
	</tr>
<?php
}
?>
</table>

<?php include_once('includes/footer.php'); 	 ?>